home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / blit.zip / BT.C < prev    next >
C/C++ Source or Header  |  1988-02-21  |  754b  |  41 lines

  1. #include <dos.h>
  2. #include "blit.h"
  3.  
  4. #define video(x)    {_AX = x;geninterrupt(0x10);}
  5. #define mouse(x)    {_AX = x;geninterrupt(0x33);}
  6.  
  7. /*
  8.  * this code assumes an EGA and a mouse.
  9.  */
  10.  
  11. main()
  12. {
  13.     struct bitmap src, dest;
  14.     int    buttons;
  15.  
  16.     video(0x10);
  17.     printf("hello");
  18.  
  19.     src.bounds.left = 8;
  20.     src.bounds.right = 28;
  21.     src.bounds.top = 0;
  22.     src.bounds.bot = 14;
  23.     src.bytes = dest.bytes = 80;
  24.     src.pntr = dest.pntr = MK_FP(0xa000, 0);
  25.  
  26.     mouse(1);
  27.     do {
  28.         mouse(3);
  29.         buttons = _BX;
  30.         dest.bounds.left = _CX;
  31.         dest.bounds.top = _DX;
  32.         dest.bounds.right = dest.bounds.left + 20;
  33.         dest.bounds.bot = dest.bounds.top + 14;
  34.         mouse(2);
  35.         blit(&src, &dest, or_verb);
  36.         mouse(1);
  37.     } while (buttons == 0);
  38.     mouse(2);
  39.  
  40.     video(0x3);
  41. }